import { createRouter, createWebHistory } from 'vue-router';

const router = createRouter({
	history: createWebHistory(),
	routes : [
    // 首页
    {
      path: '/home',
      name: 'Home',
      component: () => import('@/views/home/index.vue'),
      meta: {
        title: '首页'
      }
    },
    // 排行榜
    {
      path: '/top',
      name: 'Top',
      component: () => import('@/views/top/index.vue'),
      meta: {
        title: '排行榜'
      }
    }, 
    // 分类 
    {
      path: '/category',
      name: 'Category',
      component: () => import('@/views/category/index.vue'),
      meta: {
        title: '分类'
      },
    }, 
    // 分类详情
    {
      name: "Categorylist",
      path: "/categorylist",
      component: () => import("@/views/categorylist/index.vue"),
      meta: {
        title: "分类详情",
      },
    },
    // 听单
    {
      path: '/ting',
      name: 'Ting',
      component: () => import('@/views/ting/index.vue'),
      meta: {
        title: '听单'
      }
    }, 
    // 搜索
    {
      path: '/search',
      name: 'Search',
      component: () => import('@/views/search/index.vue'),
      meta: {
        title: '搜索'
      }
    },
    // 搜索列表
    {
      path: '/searchlist',
      name: 'Searchlist',
      component: () => import('@/views/searchlist/index.vue'),
      meta: {
        title: '搜索列表'
      }
    },
    // 播放列表
    {
      path: '/play',
      name: 'Play',
      component: () => import('@/views/play/index.vue'),
      meta: {
        title: '播放列表'
      }
    },
    // 重定向
    {
      path: '/',
      redirect: '/home'
    }
  ]
})

export default router;